using StructureMap.Pipeline;

namespace StructureMap.WcfIntegration
{
    public class WCFInstanceContextLifecycle : ILifecycle
    {
        public void EjectAll()
        {
            FindCache().DisposeAndClear();
        }

        public IObjectCache FindCache()
        {
            return WCFContextCacheExtension.Current.Cache;
        }
    }
}